﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class nav : System.Web.UI.Page
{
    AccessDAO dao = new AccessDAO();
    protected void Page_Load(object sender, EventArgs e)
    {
        Session["ss"] = "";
        if (!Page.IsPostBack)
        {

            string sss = "select * from fw";
            DataSet dss = dao.getDs(sss);
            this.reFw.DataSource = dss;
            this.reFw.DataBind();
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string name=this.Text1.Value.ToString();

        if (!name.Equals(""))
        {
            string ss = "select * from newMessage where newMessage.title like'%" + name + "%'";

            DataSet ds = dao.getDs(ss);
            if (ds.Tables["message"].Rows.Count != 0)
            {
                Session["ss"] = ss;
                Response.Write(" <script Language=Javascript>window.top.location=\"Found.aspx\"; </script>");
            }
            else
            {
                RegisterStartupScript("check", "<script language='javascript'>alert('对不起，没有你要找的信息');</script>");
            }
        }
        else
        {
            RegisterStartupScript("check", "<script language='javascript'>alert('请输入搜索信息');</script>");
        }
    }
}
